﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ebc.patterns
{
    public class MessageDecomposer<TMessage, TOut0, TOut1>
    {
        private readonly Action<TMessage, Action<TOut0>, Action<TOut1>> decomposer;

        public MessageDecomposer(Action<TMessage, Action<TOut0>, Action<TOut1>> decomposer)
        {
            this.decomposer = decomposer;    
        }


        public void In_Decompose(TMessage msg)
        {
            this.decomposer(msg, this.Out0, this.Out1);
        }


        public event Action<TOut0> Out0;
        public event Action<TOut1> Out1;
    }
}
